﻿//fs
//#version 150

uniform sampler2D texture0;
uniform sampler1D texture1;
uniform sampler2D texture2;


in vec2 passTexCoord;
in vec3 passPos;

out vec4 outColor;

void main() {
    vec4 c0 = texture(texture0, passTexCoord);
    float texCoord = (sqrt(passPos.x * passPos.x + passPos.y * passPos.y + passPos.z * passPos.z) - 0.5) / (sqrt(0.5 * 0.5 * 3) - 0.5);
    vec4 c1 = texture(texture1, texCoord);
    vec4 c2 = texture(texture2, passTexCoord);

    outColor = vec4((c0 + c2).xyz / 3, 1);
}